In Svelte, you can conditionally render a block of HTML using the {#if}, {:else if}, and {:else} block syntax. These work similarly to if, else if, and else statements in JavaScript, but are written directly inside your markup.
{#if} is used to render a block only when a condition is true.
{:else if} can be added to check additional conditions.
{:else} is used to render a default block when all conditions are false.
Svelte automatically updates the DOM when the condition changes.
In this example, the paragraph content changes depending on whether isLoggedIn is true or false. The button toggles the state.
Here, Svelte renders different content based on the value of score, similar to nested if-else statements in JavaScript.